\(\int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx\) [25]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 68 \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 \cos (c+d x)}{d}+\frac {b^2 \cos (c+d x)}{d}+\frac {b^2 \sec (c+d x)}{d}-\frac {2 a b \sin (c+d x)}{d} \]

[Out]

2*a*b*arctanh(sin(d*x+c))/d-a^2*cos(d*x+c)/d+b^2*cos(d*x+c)/d+b^2*sec(d*x+c)/d-2*a*b*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3598, 2718, 2672, 327, 212, 2670, 14} \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {a^2 \cos (c+d x)}{d}+\frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \cos (c+d x)}{d}+\frac {b^2 \sec (c+d x)}{d} \]

[In]

Int[Sin[c + d*x]*(a + b*Tan[c + d*x])^2,x]

[Out]

(2*a*b*ArcTanh[Sin[c + d*x]])/d - (a^2*Cos[c + d*x])/d + (b^2*Cos[c + d*x])/d + (b^2*Sec[c + d*x])/d - (2*a*b*
Sin[c + d*x])/d

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2670

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3598

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Expand[Sin[e
+ f*x]^m*(a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (a^2 \sin (c+d x)+2 a b \sin (c+d x) \tan (c+d x)+b^2 \sin (c+d x) \tan ^2(c+d x)\right ) \, dx \\ & = a^2 \int \sin (c+d x) \, dx+(2 a b) \int \sin (c+d x) \tan (c+d x) \, dx+b^2 \int \sin (c+d x) \tan ^2(c+d x) \, dx \\ & = -\frac {a^2 \cos (c+d x)}{d}+\frac {(2 a b) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}-\frac {b^2 \text {Subst}\left (\int \frac {1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a b \sin (c+d x)}{d}+\frac {(2 a b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}-\frac {b^2 \text {Subst}\left (\int \left (-1+\frac {1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d} \\ & = \frac {2 a b \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 \cos (c+d x)}{d}+\frac {b^2 \cos (c+d x)}{d}+\frac {b^2 \sec (c+d x)}{d}-\frac {2 a b \sin (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.86 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.63 \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {\sec (c+d x) \left (a^2-3 b^2+\left (a^2-b^2\right ) \cos (2 (c+d x))+4 a b \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+2 a b \sin (2 (c+d x))\right )}{2 d} \]

[In]

Integrate[Sin[c + d*x]*(a + b*Tan[c + d*x])^2,x]

[Out]

-1/2*(Sec[c + d*x]*(a^2 - 3*b^2 + (a^2 - b^2)*Cos[2*(c + d*x)] + 4*a*b*Cos[c + d*x]*(Log[Cos[(c + d*x)/2] - Si
n[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + 2*a*b*Sin[2*(c + d*x)]))/d

Maple [A] (verified)

Time = 1.12 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.22

method result size
derivativedivides \(\frac {-a^{2} \cos \left (d x +c \right )+2 a b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )}{d}\) \(83\)
default \(\frac {-a^{2} \cos \left (d x +c \right )+2 a b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )}{d}\) \(83\)
risch \(\frac {i {\mathrm e}^{i \left (d x +c \right )} a b}{d}-\frac {{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 d}+\frac {{\mathrm e}^{i \left (d x +c \right )} b^{2}}{2 d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} a b}{d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}+\frac {{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 d}+\frac {2 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(174\)

[In]

int(sin(d*x+c)*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(-a^2*cos(d*x+c)+2*a*b*(-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))+b^2*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^
2)*cos(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.32 \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}{d \cos \left (d x + c\right )} \]

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

(a*b*cos(d*x + c)*log(sin(d*x + c) + 1) - a*b*cos(d*x + c)*log(-sin(d*x + c) + 1) - 2*a*b*cos(d*x + c)*sin(d*x
 + c) - (a^2 - b^2)*cos(d*x + c)^2 + b^2)/(d*cos(d*x + c))

Sympy [F]

\[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \sin {\left (c + d x \right )}\, dx \]

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))**2,x)

[Out]

Integral((a + b*tan(c + d*x))**2*sin(c + d*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.99 \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - a^{2} \cos \left (d x + c\right )}{d} \]

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

(b^2*(1/cos(d*x + c) + cos(d*x + c)) + a*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)) -
a^2*cos(d*x + c))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2405 vs. \(2 (68) = 136\).

Time = 1.08 (sec) , antiderivative size = 2405, normalized size of antiderivative = 35.37 \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=\text {Too large to display} \]

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-(a*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2
*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + ta
n(1/2*c)^2 + 1))*tan(1/2*d*x)^4*tan(1/2*c)^4 - a*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1
/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(
1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^4*tan(1/2*c)^4 + a^2*tan(1/2*d*x)^4
*tan(1/2*c)^4 - 2*b^2*tan(1/2*d*x)^4*tan(1/2*c)^4 - 4*a*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^
2*tan(1/2*c) + 2*tan(1/2*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+ tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^4 - 4*a*b*log(2*(t
an(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(
1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1
))*tan(1/2*d*x)^3*tan(1/2*c) + 4*a*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(
1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan
(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)^3*tan(1/2*c) + 4*a*b*tan(1/2*d*x)^4*tan(1/2*c) +
24*a*b*tan(1/2*d*x)^3*tan(1/2*c)^2 - 4*a*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) +
2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)
^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)*tan(1/2*c)^3 + 4*a*b*log(2*(tan(1/2*d*x)^2*
tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*t
an(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2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an(1/2*d*x)^2*tan(1/2*c
)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)*tan(1/2*c) + 4*a*b*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 -
 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) +
2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1))*tan(1/2*d*x)*tan(1/2*c) -
 24*a*b*tan(1/2*d*x)^2*tan(1/2*c) - 24*a*b*tan(1/2*d*x)*tan(1/2*c)^2 - 4*a*b*tan(1/2*c)^3 - 2*a^2*tan(1/2*d*x)
^2 - 8*a^2*tan(1/2*d*x)*tan(1/2*c) + 8*b^2*tan(1/2*d*x)*tan(1/2*c) - 2*a^2*tan(1/2*c)^2 + a*b*log(2*(tan(1/2*d
*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2*tan(1/2*c) + 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2
 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2*c)^2 + 1)) - a*b
*log(2*(tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^2*tan(1/2*c) - 2*tan(1/2*d*x)*tan(1/2*c)^2 + tan(1/2*d*x)
^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*d*x)^2*tan(1/2*c)^2 + tan(1/2*d*x)^2 + tan(1/2
*c)^2 + 1)) + 4*a*b*tan(1/2*d*x) + 4*a*b*tan(1/2*c) + a^2 - 2*b^2)/(d*tan(1/2*d*x)^4*tan(1/2*c)^4 - 4*d*tan(1/
2*d*x)^3*tan(1/2*c)^3 - d*tan(1/2*d*x)^4 - 4*d*tan(1/2*d*x)^3*tan(1/2*c) - 4*d*tan(1/2*d*x)*tan(1/2*c)^3 - d*t
an(1/2*c)^4 - 4*d*tan(1/2*d*x)*tan(1/2*c) + d)

Mupad [B] (verification not implemented)

Time = 4.79 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.37 \[ \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {4\,a\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-2\,a^2+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+4\,b^2}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-1\right )} \]

[In]

int(sin(c + d*x)*(a + b*tan(c + d*x))^2,x)

[Out]

(4*a*b*atanh(tan(c/2 + (d*x)/2)))/d - (2*a^2*tan(c/2 + (d*x)/2)^2 - 2*a^2 + 4*b^2 + 4*a*b*tan(c/2 + (d*x)/2)^3
 - 4*a*b*tan(c/2 + (d*x)/2))/(d*(tan(c/2 + (d*x)/2)^4 - 1))